﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using BussinesLogic;
using System.Collections;

namespace DataAccess.Factory
{
    class IndiceFactoryDao : BaseFactory
    {

        public IndiceFactoryDao()
        {
            this.classType = typeof(Indice);
        }

        private string uspGetIndice = @"fd_Indice_get_Indice";

        /* funciones */

        public Indice getIndice(string CodIndice, string NoExpediente)
        {
            SqlParameter [] parameter = new SqlParameter[2];

            parameter[0] = new SqlParameter("@CodIndice", CodIndice);
            parameter[1] = new SqlParameter("@NoExpediente", NoExpediente);
            
            ArrayList obj = this.DataTableToObjectList(parameter, this.uspGetIndice);

            if (obj != null && obj.Count > 0)
            {
                return (Indice)obj[0];
            }
            else
            {
                return null;
            }
            
        }
    }
}
